package com.moneytree.service.impl;

import java.util.List;

import com.moneytree.model.Invest;
import com.moneytree.service.InvestService;
import com.moneytree.utils.Page;
import com.moneytree.utils.PersistenceUtils;

public class InvestServiceImpl extends PersistenceUtils<Invest, String> implements InvestService {

	@Override
	public Invest queryById(String id) {
		return get(id);
	}

	@Override
	public void saveOrUpdate(Invest invest) {
		saveOrUpdate(invest);
	}

	@Override
	public void delete(Invest invest) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Invest queryInvest(Invest invest) {
		return query(invest);
	}

	@Override
	public Page queryBean(Invest invest, Page page) {
		int start = Page.countOffset(page.getPageSize(), page.getCurrentPage());
		int allCount = super.count(invest);
		List<Invest> list = super.queryList(invest, start, page.getPageSize());
		return Page.toPage(list, page.getCurrentPage(), page.getPageSize(), allCount);
	}

}
